#!/bin/sh

if [ -f "/opt/kde4-deps/var/run/dbus/pid" ]; then
	PID=`cat "/opt/kde4-deps/var/run/dbus/pid"`
	if [ `/bin/ps -p "${PID}" | /usr/bin/grep -c "^ *${PID} "` -eq 0 ]; then
		rm -f "/opt/kde4-deps/var/run/dbus/pid"
		exec "/opt/kde4-deps/bin/dbus-daemon" --system --nofork
	fi
else
	exec "/opt/kde4-deps/bin/dbus-daemon" --system --nofork
fi

exit 0
